package com.bite.demo.component;

import com.bite.demo.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component("userName")
public class UserComponent {
    public void sayHi() {
        System.out.println("Hi,UserComponent...");
    }
    //@Primary
    @Bean({"u1","u2"})
    public UserInfo userInfo() {
        return new UserInfo(1,"zhangsan");
    }
    @Bean
    public UserInfo userInfo2() {
        return new UserInfo(2,"lisi");
    }
}
